package com.visionet.school.app.web.web.account;

import com.google.common.collect.Maps;
import com.visionet.school.app.web.common.constant.BusinessStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * LoginController负责打开登录页面(GET请求)和登录出错页面(POST请求)，

 * 真正登录的POST请求由Filter完成,
 * 
 * @author xt
 */
@Controller
public class LoginController {
	private static Logger logger = LoggerFactory.getLogger(LoginController.class);

    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public ResponseEntity<?> login(HttpServletResponse response) {
        Map<String,String> result = Maps.newHashMap();
        result.put("code", BusinessStatus.SESSION_INVALID);
        result.put("msg", "sessionInvalid");
        response.setHeader("sessionInvalid", "true");
        return new ResponseEntity(result ,HttpStatus.OK);
    }




}
